home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK1.toast / Development Kits (Disc 1) / Open Transport / Sample Code / DLPI / OT DLPI Sample1.0B7 / Common Source / HWSpecific.h < prev    next >
Encoding:
Text File  |  1995-06-20  |  3.6 KB  |  94 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        HWSpecific.h
  3.  
  4.     Contains:    This file contains macros and structures for the ABC Vendor
  5.                 Ethernet DLPI.
  6.  
  7.     Written by:    
  8.  
  9.     Copyright:    © 1993-1994 by Apple Computer, Inc., all rights reserved.
  10.  
  11.     Change History (most recent first):
  12.  
  13.  
  14.     To Do:
  15. */
  16.  
  17. //#define kPCIDeviceInfoName        "\ppci1234,5678"    // pascal string,vendor ID & device id
  18. //#define kModuleDeviceInfoName    "pci1234,5678"        // c string, vendor ID & device id
  19.  
  20. #define kPCIDeviceInfoName        "\ppci1022,2000"    // pascal string,vendor ID & device id
  21. #define kModuleDeviceInfoName    "pci1022,2000"        // c string, vendor ID & device id
  22.  
  23. //#define kPCIDeviceInfoName        "\ppci1011,2"    // pascal string,vendor ID & device id
  24. //#define kModuleDeviceInfoName    "pci1011,2"        // c string, vendor ID & device id
  25.  
  26. //#define kPCIDeviceInfoName        "\p00000C5,FastEtherTX"    // pascal string,vendor ID & device id
  27. //#define kModuleDeviceInfoName    "00000C5,FastEtherTX"        // c string, vendor ID & device id
  28.  
  29. //-----------------------------------------------------------------------------------------
  30. //    Generic enums
  31. //-----------------------------------------------------------------------------------------
  32.  
  33. enum BooleanStates
  34.     {
  35.     kFalse    = 0,
  36.     kTrue    = 1
  37.     };
  38.  
  39. enum InterruptStates
  40.     {
  41.     kNoInterrupts            = 0,
  42.     kTxInterrupts            = 1,
  43.     kRxInterrupts            = 2,
  44.     kBothTxRxInterrupts        = 3
  45.     };
  46.  
  47. //-----------------------------------------------------------------------------------------
  48. // Private driver flags for privateFlags variable in dlpiPrivateData
  49. //-----------------------------------------------------------------------------------------
  50. #define kpfFraming8022                0x00000001
  51.  
  52. //-----------------------------------------------------------------------------------------
  53. //    DLPI Private Data structure
  54. //-----------------------------------------------------------------------------------------
  55.  
  56. struct DLPIPrivateData
  57.     {
  58.     UInt32                privateFlags;                // 32 1 bit flags for driver usage
  59.     QHdr                dlpiStreamsQueue;            // linked list of active streams
  60.     QHdr                RxPacketQueue;                // linked list of received packets
  61.     QHdr                TxPacketQueue;                // linked list of packets to transmit
  62.     UInt8                ourEAddress[6];                // store our Ethernet address
  63.     SInt32                TxDeferredTaskCookie;
  64.     SInt32                RxDeferredTaskCookie;
  65.     RegEntryID            nodeEntryID;                // our entry in the Name Registry
  66.     UInt32                cardBaseAddr;                // only necessary for memory mapped cards
  67.     UInt16                currentMinorDeviceNumber;    // minor device number used in open
  68.     };
  69.  
  70. typedef struct DLPIPrivateData DLPIPrivateData;        
  71.     
  72. //-----------------------------------------------------------------------------------------
  73. //    Function Prototypes
  74. //-----------------------------------------------------------------------------------------
  75.  
  76. void EnqueueElementAtHead(QHdr *theQHdr, QElem *theElem, UInt16 whichIntsOff);
  77. void EnqueueElement(QHdr *theQHdr, QElem *theElem, UInt16 whichIntsOff);
  78. QElem *DequeueHead(QHdr *theHdr, UInt16 whichIntsOff);
  79. QElem *DequeueElement(QHdr *theQHdr, QElem *theElem, UInt16 whichIntsOff);
  80.  
  81.  
  82. Boolean ABCVendorIsThisOurCard(RegEntryID *theID, UInt32 cardAddress);
  83. void ABCVendorDisableInterrupts(UInt16 whichIntsOff);
  84. void ABCVendorEnableInterrupts(UInt16 whichIntsOn);
  85. SInt32 ABCVendorRegisterMulticast(UInt8 *mcAddress);
  86. SInt32 ABCVendorUnregisterMulticast(UInt8 *mcAddress);
  87. void ABCVendorInitialize(RegEntryID *theID);
  88. void ABCVendorClose(void);
  89. void ABCVendorTransmitOnePacket(mblk_t *thePacket, UInt16 packetSize);
  90. OSErr ABCVendorCheckTransmitterStatus(UInt16 packetSize);
  91. SInt32 ABCVendorSetEthernetAddress(UInt8 *physicalAddress);
  92. void ABCVendorGetFactoryEthernetAddress(UInt8 *addressArray);
  93. InterruptMemberNumber ABCVendorISR(InterruptSetMember member, void *refCon, UInt32 theIntCount);
  94.